package edu.sctu.nieyu.day20150520;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user01 on 2015/5/20.
 */
public class TextOne extends TextMore {
    public void getTercherInfo(){

        List<Teacher> list = sotrNumber();

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i).getName());
            System.out.println("编号："+list.get(i).getNumber()+"\t职称："+list.get(i).getTitle()+"\t性别："+list.get(i).getSex()+"课程："+list.get(i).getLesson());

            System.out.println("所教学生：");

            for (int j = 0; j < list.get(i).getStudent().size(); j++) {
                System.out.println(list.get(i).getStudent().get(j).getName());
            }

        }

    }

  public List<Student> getStudent(int code,List<Student> list){
           List<Student> list1 = new ArrayList<>();
          for (int i = 0; i < list.size(); i++) {
           if (list.get(i).getGradle()>code){
             list1.add(list.get(i));
            }
          }
            return list1;
          }



    Interface interMod = new Interface() {
        @Override
        public void message(List<Student> list) {


            List<Student> list1 = getStudent(50,list);
            System.out.println("教授下成绩大于"+90+"的学生："+list1.size());
            for (int i = 0; i < list1.size(); i++) {


                System.out.print(list1.get(i).getName()+"\t");
            }


        }
    };


    public void getCode(){

        List<Teacher> listTeacher = pritCoded();

          List<Student> listStudent = new ArrayList<>();

           for (int i = 0; i < listTeacher.size(); i++) {
              listStudent = listTeacher.get(i).getStudent();
           }

                          interMod.message(listStudent);


               }

           }




